<template>
  <Row type="flex" :gutter="18">
    <Col :span=19>
      <Panel shadow :padding=10>
        <div slot="title">作业状态</div>
          <div slot="extra">
            <ul class="filter">
              <li>
                <Button type="info" @click="onRefresh">
                  <Icon type="refresh"></Icon>
                  刷新
                </Button>
              </li>
            </ul>
          </div>
          <Alert type="success" show-icon>
          审核通过
          <span slot="desc">代码已成功编译运行</span>
          </Alert>
          <Card :bordered="false">
            <p slot="title">老师评语</p>
            <p>写的都是狗屎,滚回去种田吧!</p>
        </Card>
        </Panel>
    </Col>
    <Col :span="5">
      <Menu :theme="theme2" @on-select="handleRoute">
        <MenuItem name="/homework/deatil"><Icon type="ios-paper"></Icon>题目详情</MenuItem>
        <MenuItem name="/homework/status"><Icon type="ios-paper"></Icon>运行状态</MenuItem>
      </Menu>
    </Col>
  </Row>
</template>

<script>
  import Pagination from '@oj/components/Pagination'
  import CodeMirror from '@oj/components/CodeMirror.vue'
  
  export default {
    name: 'homeworkList',
    components: {
      Pagination
    },
    data () {
      return {
        columns1: [
          {
            title: '作业名称',
            key: 'name'
          },
          {
            title: '作业类型',
            key: 'age'
          },
          {
            title: '作业状态',
            key: 'address',
            width: 150,
            align: '',
            render: (h, params) => {
              let t = params.row.difficulty
              let color = 'blue'
              if (t === '完成') color = 'green'
              else if (t === '未完成') color = 'red'
              return h('Tag', {
                props: {
                  color: color
                }
              }, params.row.difficulty)
            }
          },
          {
            title: '截止日期',
            key: 'date'
          }
        ],
        data1: [
          {
            id: '1',
            name: 'Python 数据爬虫-1',
            age: 'Python',
            address: '未完成',
            date: '2019-10-08',
            difficulty: '未完成'
          }
        ]
      }
    }
  }
</script>
